<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
 <%@ page import="java.util.ArrayList, linkeddataweb.professor.Professor" %>
<%@ page import="javax.servlet.http.HttpServlet" %>
<%@ page import="javax.servlet.http.HttpSession" %>
<% request.getSession(true); %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>List of researchers names</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>

<body>
<div id="container">

	<div id="top">
    	<h1 class="title">Linked Data Project</h1>
  	</div>

<table style="margin-top:20px;">
  
  		<tr>
  			<td><a href="ProfessorRegister.jsp" title="Professor Register">Professor Sign up</a></td>
  			<td><a href="Search.jsp" title="Search for Researcher">Search</a></td>
    	</tr>

    	
    </table>


	<div id="leftSide">

  	<table>
		<tr>
			<th>Name</th>
		</tr>

<% ArrayList<Professor> p = new ArrayList<Professor>();
  	p = (ArrayList<Professor>)session.getAttribute("professor");
  	
	if(p.size() == 0){
  		out.println("<h1 style=\"background-color:#eee\">No result found.</h1>");
  	}else{
  		for(int i=0; i < p.size(); i++){
   %>
   
    	<tr>
    		<td><a href="search?professorName=<%= p.get(i).getName()  %>" title="<%= p.get(i).getName()  %>"><%= p.get(i).getName()  %></a></td>
    	</tr>
    	
 
    
    <% 		} //end for
  		}// end else
    %>
    
    </table>
  </div>

  
  <div class="clear"></div>
</div>
</body>
</html>